﻿using System;
using HK.Core.Common.Data;
using HK.Core.Common.Protocol;
using HK.Core.Common.Protocol.Data;
using HK.Core.Serializable;
using HK.Core.Serializable.Data;

namespace HK.Core.Settings
{
    
    /// <summary>
    /// 序列化资产文件
    /// </summary>
    /// <typeparam name="TAsset">资产文件类型</typeparam>
    /// <typeparam name="TData">数据类型</typeparam>
    public abstract class SSettings<TAsset, TData> : SAsset<TAsset, TData>
        where TAsset : SAsset
        where TData : SAssetData, new()
    {
        /// <summary>
        /// 保护构造函数
        /// </summary>
        /// <param name="iStatic">静态文件标志位</param>
        /// <param name="iCreateTime">创建时间</param>
        protected SSettings(bool iStatic, long iCreateTime = 0L) : base(iStatic, iCreateTime) { }
        
    }

    /// <summary>
    /// 序列化资产文件 - 列表
    /// </summary>
    /// <typeparam name="TAsset">资产文件类型</typeparam>
    /// <typeparam name="TBody">列表Body类型</typeparam>
    /// <typeparam name="TElement">列表Element类型</typeparam>
    public abstract class SListSettings<TAsset, TBody, TElement> : SAssetList<TAsset, TBody, TElement>
        where TAsset : SAsset
        where TBody : SAssetListData<TBody, TElement>, new()
        where TElement : JsonData, IListElement, IEquatable<TElement>
    {
        /// <summary>
        /// 保护构造函数
        /// </summary>
        /// <param name="iStatic">静态文件标志位</param>
        /// <param name="iCreateTime">创建时间</param>
        protected SListSettings(bool iStatic, long iCreateTime = 0L) : base(iStatic, iCreateTime) { }
    }
    
}
